-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error handling after increasing the array index #280
Conversation
After increasing the array index, an error handling must be included, because if the input is extended later again, we can look for the error again. A handled error is easier to find and fix than a buffer overwrite error. Table index should start from 0, because it indicates better that the table is empty. Signed-off-by: Janos Varga <113785741+vargajb@users.noreply.github.com>
I'm technically okay with merging this. However, this code is part of the COBOL Debugging Challenge on the Advanced Topic chapter, and I'm not the one who made the challenge. So, tagging @jellypuno here to see if she has any feedbacks about it. |
Hi @jellypuno, you made the COBOL Debugging Challenge on the Advanced Topic of Cobol Programming Course in Openmainframeproject.
IS-OVERLIMIT.
IF ACCT-LIMIT < ACCT-BALANCE THEN
ADD 1 TO SUB1
* Check if there is enough space in the array, in case the input
* file changes again. A handled error is easier to find and fix
* than a buffer overwrite error.
IF SUB1 > OVERLIMIT-MAX THEN
DISPLAY 'OVERFOLW TABLE OVERLIMIT'
MOVE 1000 TO RETURN-CODE
STOP RUN
END-IF
MOVE ACCT-LIMIT TO OL-ACCT-LIMIT(SUB1)
MOVE ACCT-BALANCE TO OL-ACCT-BALANCE(SUB1)
MOVE LAST-NAME TO OL-LASTNAME(SUB1)
MOVE FIRST-NAME TO OL-FIRSTNAME(SUB1)
END-IF.
I tested the changes. Thanks! BR: |
Hi @tanto259, we didn’t get any feedback from @jellypuno. She seems to be very busy. What is my correction about?
Should I explain my correction in more detail? Thanks! BR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll just merge this first after the typo is fixed. I personally have no objections on the edit. If she have any feedbacks, we can always make changes later on.
COBOL Programming Course #3 - Advanced Topics/Challenges/Debugging/cbl/CBL0106C.cbl
Outdated
Show resolved
Hide resolved
Signed-off-by: Janos Varga <113785741+vargajb@users.noreply.github.com>
Thanks, @vargajb! |
Signed-off-by: Janos Varga 113785741+vargajb@users.noreply.github.com
Proposed changes
Fixes # (issue)
Type of change
What type of changes does your PR introduce to the COBOL Programming Course? Put an
x
in the boxes that apply.Checklist:
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer